home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / PDraw3.0.adf / pdraw_rex.lzh / AutoSave.pdrx < prev    next >
Text File  |  1992-06-18  |  1KB  |  49 lines

  1. /*
  2. @N
  3.  
  4. This Genie will prompt you to save at a specified time interval. You may optionally have the current file backed up before saving commences.
  5. */
  6. cr = '0a'x
  7. arg options
  8.  
  9. interval = word(options, 1)
  10. backup    = word(options, 2)
  11.  
  12. tval = getclip(pdautosave)
  13.  
  14. if tval = '' then
  15. do
  16.     startas = 1
  17.     tval = 5
  18. end
  19.  
  20. if ~exists("rexx:pdrawautosave.rexx") then
  21.     exit_msg("Unable to find PDraw autosave Genie in rexx: directory")
  22.  
  23. if interval = '' then
  24. do
  25.     response = upper(pdm_GetForm("Enter time interval", 8, "Time interval in minutes:"tval||cr"Create backup file Y/N:Y"))
  26.     if response = '' then exit_msg()
  27.     parse var response tval '0a'x backup
  28.     if ~datatype(tval, n) | tval < 0  then exit_msg("Invalid Entry")
  29. end
  30.  
  31. if backup   ~= 'Y' then backup = 'N'
  32.  
  33. call setclip(pdautosave, tval)
  34. if startas ~= 1 then exit
  35.  
  36. address command
  37. 'run >nil:' "rx rexx:pdrawautosave.rexx "backup
  38.  
  39. exit_msg()
  40.  
  41. exit_msg: procedure
  42. do
  43.     parse arg message
  44.  
  45.     if message ~= '' then
  46.    call pdm_Inform(1, message, )
  47.     exit
  48. end